﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace FeatureModelTool.Windows
{
    /// <summary>
    /// Interaction logic for NewPropertyDialog.xaml
    /// </summary>
    public partial class NewPropertyDialog : Window
    {
        public bool Dirty { get; protected set; }
        public string PropertyName { get; protected set; }
        public string PropertyValue { get; protected set; }
        public NewPropertyDialog(string name, string value)
        {
            InitializeComponent();

            this.nameTextBox.Text = name;
            this.valueTextBox.Text = value;
            Dirty = false;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void okButton_Click(object sender, RoutedEventArgs e)
        {
            if (this.nameTextBox.Text == string.Empty)
            {
                return;
            }
            Dirty = true;
            PropertyName = nameTextBox.Text;
            PropertyValue = valueTextBox.Text;

            this.Close();
        }
    }
}
